<!DOCTYPE html>
<html>
<head>
    {{theme:partial name = "business/metadata"}}
	
	{{if background}}
	
	<style type="text/css">
	div.bg-user{
		background:#{{background}} !important;
	}
	ul.action ul.hide, ul.hide{
		border-color:#{{background}} !important;
	}
	a.bg-user,h2.bg-user,.cl.bg-user{
		color:#{{background}};
	}
	.btn.bg-user{
		color:#fff;
		background:#{{background}} !important;
		border:none;
		padding:5px;
		cursor: pointer;
	}
	.btn.btn2{
		/*border-radius: 4px 4px 4px 4px;
		background-image: linear-gradient(to bottom, #fff, #{{background}}) !important;
		border-color: #{{background}} !important;*/
	}
	.btn.btn2:hover{
		/*background-color: #{{background}} !important;*/
	}
	ul.so-do a{
		background:#{{background}} !important;
		border: 1px solid #{{background}};
	}
	.tree ul ul:before,.tree li:after{
		border-left: 1px solid #{{background}};
	}
	.tree li:last-child:before{
		border-right: 1px solid #{{background}};
	}
	
	.tree li:before, .tree li:after{
		border-top: 1px solid #{{background}};
	}
	.tree li a:hover, .tree li a:hover + ul li a{
		color:#fff;
		text-decoration:underline;
	}
	</style>
	{{endif}}
	<script type="text/javascript">
		var theme_path = '{{theme:path}}';
		kunkun = {'lang': {
			dialog_message:"{{ helper:lang line='global:delete_dialog' }}",
			view: "{{ helper:lang line='global:view' }}",
			row: "{{ helper:lang line='global:row' }}",
			null: "{{ helper:lang line='global:null' }}",
			row_in_page: "{{ helper:lang line='global:row_in_page' }}",
			show: "{{ helper:lang line='global:show' }}",
			to: "{{ helper:lang line='global:to' }}",
			of: "{{ helper:lang line='global:of' }}",
			search: "{{ helper:lang line='global:search' }}",
			first: "{{ helper:lang line='global:first' }}",
			last: "{{ helper:lang line='global:last' }}",
			after: "{{ helper:lang line='global:after' }}",
			before: "{{ helper:lang line='global:before' }}",
		} };
	</script>
</head>
<body>
<div id="headder1" class="bg-user">
	<div style="min-width:170px" class="c_clogo c_clogoi">
		<h1>
		<a href="" class="hover c_clogot b-inline" id="c_clogot">
			<span class="c_clogoimg"><span class="is_c">
			<a href="{{url:site uri=''}}">
			{{theme:image file='business/logo.png' class='is_img'}}
			</a>
			
			</span></span>&nbsp;</a>
			
			<span class="c_ms"></span>
		</h1>
	</div>
	<ul class="fl action">
		<li class="hasChild fl">
			<a title="" class="b-inline hover" id="c_clogoc" href="#">&nbsp;
					<img class="is_img"  src="{{theme:image_url file='business/invis.gif'}}" style="background-image:url('{{theme:image_url file='business/c5.png'}}');background-position:-92px -33px;width:11px;height:9px;" />
			</a>
			<ul class="hide pd">
				<p class="tc">{{helper:lang line='global:day'}} {{time_zone:d}} 
								{{helper:lang line='global:month'}} {{time_zone:m}} 
								{{helper:lang line='global:year'}} {{time_zone:Y}} 
					<span class="upc"> : {{time_zone:a}}</span>
				</p>
				<ul id="clock">	
					<li id="sec"></li>
					<li id="hour"></li>
					<li id="min"></li>
				</ul>
			</ul>
		</li>
		{{if action}}
		<li class="new hasChild fl"><a class="hover btn save" title="" href="javascript:void(0)">
			<i></i>{{helper:lang line='global:save'}}
			</a>
		</li>
		{{else}}
		<li class="new hasChild fl"><a class="hover" title="" href="javascript:void(0)">
			<i></i>{{helper:lang line='project:create'}}
			<img src="{{theme:image_url file='business/invis.gif'}}" class="d" />
			</a>
			<ul class="hide">
				<li><a href="{{ url:site uri='business/private/create' }}">{{helper:lang line='project:private'}}</a></li>
				{{ if user:group_id == 2 OR user:group_id == 3}}
				<li><a href="{{ url:site uri='business/giaoviec' }}">{{helper:lang line='project:set_in_room'}}</a></li>
				{{ endif }}
				{{ if user:group_id==2 }}
				<li><a href="{{ url:site uri='business/giaoviec2' }}">{{helper:lang line='project:set_out_room'}}Giao việc phòng ban khác</a></li>
				{{endif}}
			</ul>
		</li>
		{{endif}}
	</ul>
	<ul class="user fr">
		<li class="message hasChild"><a title="{{helper:lang line='business:message'}}" class="icon">
			{{if num_mess}}
			<style>
				.num-mess{
					background: none repeat scroll 0 0 #FF0000;
					color: #fff;
					display: block;
					height: 15px;
					left: -13px;
					position: relative;
					top: 2px;
					width: 15px;
					text-indent:0;
					line-height:11px;
					font-size:80%;
					text-align: center;
					font-weight:bold;
					border-radius: 3px 3px 3px 3px;
				}
			</style>
			<span class="num-mess">{{num_mess}}</span>
			{{endif}}
			</a>
			{{if messages}}
			<ul class="hide" style="min-width:200px;">
				{{messages}}
					<li style="width:99%;"><a style="color:#333" href="{{link}}"><strong class="cl bg-user">{{display_name}}</strong> - {{content}}</a></li>
				{{/messages}}
			</ul>
			{{endif}}
		</li>
		<li class="setting hasChild"><a title="Cấu hình" class="icon">{{helper:lang line = 'business:setting'}}</a>
			<ul class="hide">
				<li class="colors">
					<a style="background:#DC4FAD" cid="DC4FAD"></a>
					<a style="background:#AC193D" cid="AC193D"></a>
					<a style="background:#D24726" cid="D24726"></a>
					<a style="background:#FF8F32" cid="FF8F32"></a>
					<a style="background:#82BA00" cid="82BA00"></a>
					<a style="background:#008A17" cid="008A17"></a>
					
					<a style="background:#03B3B2" cid="03B3B2"></a>
					<a style="background:#008299" cid="008299"></a>
					<a style="background:#5DB2FF" cid="5DB2FF"></a>
					<a style="background:#0072C6" cid="0072C6"></a>
					<a style="background:#4617B4" cid="4617B4"></a>
					<a style="background:#8C0095" cid="8C0095"></a>
					
					<a style="background:#004B8B" cid="004B8B"></a>
					<a style="background:#001940" cid="001940"></a>
					<a style="background:#570000" cid="570000"></a>
					<a style="background:#380000" cid="380000"></a>
					<a style="background:#585858" cid="585858"></a>
					<a style="background:#000000" cid="000000"></a>
				</li>
			</ul>
		</li>
		<li><a>{{user:display_name}}</a></li>
		<li class="account"><a href="{{url:site uri='users/logout'}}" title=""> | Thoát</a></li>
	</ul>
</div>
<div id="container">
	<div id="left">
		
		<h3 class="cl bg-user">{{helper:lang line='project:single'}}</h3>
		<ul>
			<li class="hover2"><a href="{{url:site uri='business'}}">{{helper:lang line='project:work'}}</a></li> <!--active-->
			<li class="hover2"><a href="{{url:site uri='business/type2'}}">{{helper:lang line='project:work_type2'}}</a></li>
			<li class="hover2"><a href="{{url:site uri='business/type3'}}">{{helper:lang line='project:work_type3'}}</a></li>
			<li class="hover2"><a href="{{url:site uri='business/type4'}}">{{helper:lang line='project:work_type4'}}</a></li>			
			<li class="hover2"><a href="{{url:site uri='business/type5'}}">{{helper:lang line='project:work_type5'}}</a></li>			
			<li class="hover2"><a href="{{url:site uri='business/private'}}">{{helper:lang line='project:private'}}</a></li>
		</ul>

		{{if boss}}
		<h3 class="cl bg-user">{{helper:lang line='project:room'}}</h3>
		<ul>
			<li class="hover2"><a href="{{url:site uri='business/room'}}">{{helper:lang line='project:work'}}</a></li>
			<li class="hover2"><a href="{{url:site uri='business/room_type2'}}">{{helper:lang line='project:work_type2'}}</a></li>
			<li class="hover2"><a href="{{url:site uri='business/room_type3'}}">{{helper:lang line='project:work_type3'}}</a></li>
			<li class="hover2"><a href="{{url:site uri='business/room_type4'}}">{{helper:lang line='project:work_type4'}}</a></li>
			<li class="hover2"><a href="{{url:site uri='business/room_type5'}}">{{helper:lang line='project:work_type5'}}</a></li>
		</ul>
		{{endif}}
		{{if user:group == 'boss1' || user:group == 'boss11' }}<!--Giam doc , pho giam doc-->
		<h3 class="cl bg-user">{{helper:lang line='project:room_orther'}}</h3>
		<ul>
			<li class="hover2"><a href="{{url:site uri='business/room_orther'}}">{{helper:lang line='project:work'}}</a></li>
			<li class="hover2"><a href="{{url:site uri='business/room_orther_type2'}}">{{helper:lang line='project:work_type2'}}</a></li>
			<li class="hover2"><a href="{{url:site uri='business/room_orther_type3'}}">{{helper:lang line='project:work_type3'}}</a></li>
			<li class="hover2"><a href="{{url:site uri='business/room_orther_type4'}}">{{helper:lang line='project:work_type4'}}</a></li>
		</ul>
		{{endif}}
		
	</div>
	<div id="content">
		<h2 class="bg-user title">{{ title }}</h2>
		{{ template:body }}
	</div>
</div>
<div id="footer" class="bg-user"><p>Copyright 2013 PH Smartstore. All rights reserved </p></div>
{{theme:js file ='admin/admin.js'}}
<script type="text/javascript">
	$('li.hasChild > a').click(function(){
		$(this).addClass('active');
		$(this).siblings('ul.hide').slideToggle(100,function(){
			//kiem tra co cai nao show thi slideUp
			
			if($(this).hasClass('cur')){
				$(this).siblings('.active').removeClass('active');
				$(this).removeClass('cur');
				}
			else
				$(this).addClass('cur');
			$(this).parent('li').siblings('.hasChild').find(' > ul.hide').slideUp(100);
		});
	});
	
$('.colors a[cid]').click(function(){
	$color = $(this).attr('cid');
	$.ajax({
		url:'{{url:site uri="emp_profile/background"}}',
		data:{background:$color},
		type:'post',
		success:function(){
			location.reload();
		}
	});
});
{{if num_mess}}
var on = false;
$num_mess = parseInt('{{num_mess}}');
$title = $('title');
$title_value = $('title').text();
setInterval(function(){
    $title_tmp = '('+$num_mess +') ' + $title_value;
    $title.text($title_tmp);
    on = true;
    if(on == true){
    setTimeout(function(){
        $title.text($title_value);
        on = false;
    },3000);
        
    }
},4000);
{{endif}}
</script>

</body>
</html>